package com.fd;

import java.sql.Connection;
import java.sql.Statement;

/**
 * 数据库操作类
 *
 * @author YangXiaoLong
 * @since 1.0.0
 */
public class DatabaseOperations {

    public static Connection connection;

    public static void insert(String insertStatement) {
        if (connection == null) {
            connection = DatabaseConnection.getConnection();
        }
        try {
            final Statement statement = connection.createStatement();
            statement.executeUpdate(insertStatement);
        } catch (Exception e) {
            throw new RuntimeException("数据库异常", e);
        }
    }
}
